/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package name.coolwind.cxblog.service;

import java.util.List;
import name.coolwind.cxblog.dao.TagDao;
import name.coolwind.cxblog.domain.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author coolwind
 */

@Service
public class TagService {
    @Autowired
    private TagDao tagDao;
    
    public List<Tag> getAllTags(){
        return tagDao.getTagsByPage(0, 0);
    }
    
    public String getTagByTagId(String tagId){
        return tagDao.getTagNameByTagId(tagId);
    }
    
    public List<Tag> getHotTag(){
        return tagDao.getTagsByPage(0, 5);
    }
}
